{% extends "panel/panel_base.html" %}
{% load truncate_filters %}
{% block panel_title%}Send Messages:{% endblock %}
{% block panel_content %}
{% if errors %}
	<div id="gen_error_message">
		Errors:
		<ul>
			{% if reciever_error %}<li>The recipient does not exist.</li>{% endif %}
			{% if content_error %}<li>The content field is required.</li>{% endif %}			
			{% if subject_error %}<li>The subject field is required.</li>{% endif %}	
		</ul>
	</div>
{% endif %}
{% if success %}
	<div id="gen_success">
		<ul>
			<li>Message Sent Successfully</li>
		</ul>
	</div><br />
{% endif %}
	<div id="message_control">
		<ul>
			<li><a href="http://fblaconnection.com/panel/{{user.username}}/messages/send/">Send a Message</a></li>
			<li><a href="http://fblaconnection.com/panel/{{user.username}}/messages/recieved/">Recieved Messages</a></li>
			<li><a href="http://fblaconnection.com/panel/{{user.username}}/messages/sent/">Sent Messages</a></li>
		</ul>
	</div>
	<div id="message_box_full">
		<form action="http://fblaconnection.com/panel/{{user.username}}/messages/send/" method="post" id="register" accept-charset="utf-8">
			<table width="300" border="0">
				<tr>
					<td align="right">Send To: </td>
					<td><input type="text" name="reciever" value="{% if message_user %}{{ message_user }}{% else %}{{ reciever }}{% endif %}" class="register_text populate" title="Username of Recipient" /></td>
				</tr>
				<tr>
					<td align="right">Subject: </td>
					<td><input type="text" name="subject" value="{% if message_rep %}RE: {{message_rep.subject}}{% else %}{{ subject }}{% endif %}" class="register_text" /></td>
				</tr>
				<tr>
					<td align="right" valign="top">Content: </td>
					<td><textarea id="content" rows="10" cols="40" name="content" class="register_text">{% if message_rep %}&#10;&#10;&#10;&#10;--Original  Message--------------------------{{message_rep.content}}{% else %}{{ content }}{% endif %}</textarea></td>
				</tr>
		  		<tr>
					<td></td>
					<td>
						<input type="submit" name="send" class="register_button" value="Send" />
					</td>
				</tr>
			</table>
		</form>
	</div>
{% endblock %}